<%-- 
    Document   : AdminMagasin
    Created on : 11 mai 2011, 18:53:23
    Author     : Mami
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="ecom.beans.entity.Productstore"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="style.css" rel="stylesheet" type="text/css" />
        <title>Admin Magasin Page</title>
    </head>
    <body>
        
        
        
        

<div id="header_wrapper">
  <div id="header">
 <div id="site_title">
      <h1><a href="#"> <img src="/Ecom-war/images/logo.png" alt="" /></a></h1>

        </div>
      <div id="firstconnex">
          <table>
              <tr>
                  <td style="visibility:hidden"></td>
                  <td style="visibility:hidden"></td>
                  <td style="visibility:hidden"></td>
                  <td style="visibility:hidden"></td>
                  <td style="visibility:hidden"></td>
                

              </tr>
          </table>
      </div>

    <div id="menu">

        <% if (request.getAttribute("Magasin") != null) {
                                ArrayList<Productstore> Magasins = (ArrayList<Productstore>) request.getAttribute("Magasin");
                                out.println("<table>");
                                out.println("<thead>La liste des magasins</thead>");
                                out.println("<tr>");
                                out.println("<th>");
                                out.println("Identifiant du magasin");
                                out.println("</th>");
                                out.println("<th>");
                                out.println("Nom du magasin");
                                out.println("</th>");
                                out.println("<th>");
                                out.println("Ville");
                                out.println("</th>");
                                out.println("Suppression");
                                out.println("</th>");
                                out.println("<th>");
                                out.println("Modification");
                                out.println("</th>");


                                out.println("</tr>");
                                for (int i = 0; i < Magasins.size(); i++) {
                                    out.println("<tr>");
                                    out.println("<td>");
                                    out.println(Magasins.get(i).getId());
                                    out.println("</td>");
                                    out.println("<td>");
                                    out.println(Magasins.get(i).getName());
                                    out.println("</td>");
                                    long numMag= Magasins.get(i).getId();
                                    out.println("<td>");
                                    out.println("<a href=\"supprimerMagasin.jsp?idMagasin=" + numMag + "\">supprimer</a>");
                                    out.println("</td>");
                                    out.println("<td>");
                                    out.println("<a href=\"Controleur?action=editer&idM=" + numMag + "\">modifier</a>");
                                    out.println("</td>");
                                    out.println("</tr>");
                                }
                                out.println("</table>");
                            }
                            // else out.println("listequestionvide");
%>
   <div id="menu">
      <ul>

        <li><a href="index.jsp" class="current">Accueil</a></li>
        <li><a href="/store?action=touslesmagasins">Mos Magasins</a></li>
        <li><a href="/store?action=listeCustomer">Clients</a></li>
        <li><a href="/store?action=listeProduitsA">Produits</a></li>
        <li><table><tr><td><input type="submit" value="Déconnexion"/></td></tr></table></li>
      </ul>
    </div>
    <!-- end of menu -->
    <div id="search_box">
      <form action="" method="get">
        <input type="text" value="Entrer un mot cles" name="q" size="10" id="searchfield" onfocus="clearText(this)" onblur="clearText(this)" />
      </form>
    </div>
    <div class="cleaner"></div>
  </div>
  <!-- end of header -->
</div>
<!-- end of header_wrapper -->

 </body>
</html>
